# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-py2neo
pkgname=('python2-py2neo' 'python-py2neo')
_pkgname=py2neo
pkgver=2021.2.4
epoch=1
pkgrel=2
pkgdesc='Python client library and toolkit for Neo4j.'
arch=('x86_64' 'aarch64')
url='https://pypi.python.org/pypi/py2neo/'
license=('Apache')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('191a235c36200411c3b0c9ca2cdb740ca5c19c34a3b9da48ddc4f05debb4e46951988b993990258db85b1751eb896a4e484f2305eadfed67978446c95c3ff443')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-py2neo() {
  depends=('python2' 'python2-certifi' 'python2-click' 'python2-colorama'
           'python2-pygments' 'python2-pytz' 'python2-urllib3' 'python2-neobolt'
           'python2-neotime' 'python2-prompt_toolkit')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/${_pkgname}2"
}

package_python-py2neo() {
  depends=('python' 'python-certifi' 'python-click' 'python-colorama'
           'python-pygments' 'python-pytz' 'python-urllib3' 'python-neobolt'
           'python-neotime' 'python-prompt_toolkit')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

